Skip to contentSkip to conversation

Change in openvpn[master]: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers co...

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Jan 14, 2025 – Jan 25, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1736865848000.Iaaf80c688ddff79ac9472d7237003713637c140b@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/867?usp=email

to review the following change.

Change subject: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning
......................................................................

tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

GCC wants us to be more explicit here.

Change-Id Iaaf80c688ddff79ac9472d7237003713637c140b

---
M src/openvpn/tls_crypt.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/867/1

src/openvpn/tls_crypt.c +1 -1
index 24df930..4c421aa 100644
@@ -691,7 +691,7 @@
     struct buffer client_key_pem = { 0 };
     struct buffer dst = alloc_buf_gc(TLS_CRYPT_V2_CLIENT_KEY_LEN
                                      + TLS_CRYPT_V2_MAX_WKC_LEN, &gc);
-    struct key2 client_key = { 2 };
+    struct key2 client_key = { .n = 2 };
 
     if (!rand_bytes((void *)client_key.keys, sizeof(client_key.keys)))
     {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/867?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iaaf80c688ddff79ac9472d7237003713637c140b
Gerrit-Change-Number: 867
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/867?usp=email )

Change subject: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/867?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iaaf80c688ddff79ac9472d7237003713637c140b
Gerrit-Change-Number: 867
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sat, 25 Jan 2025 10:08:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH v2 1/1 tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

GCC wants us to be more explicit here.

Change-Id Iaaf80c688ddff79ac9472d7237003713637c140b

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/867
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/tls_crypt.c +1 -1
index 24df930..4c421aa 100644
@@ -691,7 +691,7 @@
     struct buffer client_key_pem = { 0 };
     struct buffer dst = alloc_buf_gc(TLS_CRYPT_V2_CLIENT_KEY_LEN
                                      + TLS_CRYPT_V2_MAX_WKC_LEN, &gc);
-    struct key2 client_key = { 2 };
+    struct key2 client_key = { .n = 2 };
 
     if (!rand_bytes((void *)client_key.keys, sizeof(client_key.keys)))
     {
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

Not sure why the compiler is more picky here than on other inits, but maybe it's "... = {2}" vs "... = {0}" (which means "all is 0", so the actual element first in the struct does not matter). Anyway, ".n = 2" is what we want so there is no harm in writing that done :-) - and the buildbots agree that all platform compilers are fine with it.

Your patch has been applied to the master branch.

commit 2a50daf5fe6c924c8d945b3d0455c9e282cd769f

Author: Frank Lichtenheld
Date:   Sat Jan 25 11:08:38 2025 +0100
     tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg30588.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/867?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning
......................................................................

tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

GCC wants us to be more explicit here.

Change-Id Iaaf80c688ddff79ac9472d7237003713637c140b

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30588.html

---
M src/openvpn/tls_crypt.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/867/3

src/openvpn/tls_crypt.c +1 -1
index 76f06bc..0e5dfee 100644
@@ -692,7 +692,7 @@
     struct buffer client_key_pem = { 0 };
     struct buffer dst = alloc_buf_gc(TLS_CRYPT_V2_CLIENT_KEY_LEN
                                      + TLS_CRYPT_V2_MAX_WKC_LEN, &gc);
-    struct key2 client_key = { 2 };
+    struct key2 client_key = { .n = 2 };
 
     if (!rand_bytes((void *)client_key.keys, sizeof(client_key.keys)))
     {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/867?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iaaf80c688ddff79ac9472d7237003713637c140b
Gerrit-Change-Number: 867
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/867?usp=email )

Change subject: tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning
......................................................................

tls_crypt_v2_write_client_key_file: Fix missing-field-initializers compiler warning

GCC wants us to be more explicit here.

Change-Id Iaaf80c688ddff79ac9472d7237003713637c140b

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30588.html

---
M src/openvpn/tls_crypt.c

1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/tls_crypt.c +1 -1
index 76f06bc..0e5dfee 100644
@@ -692,7 +692,7 @@
     struct buffer client_key_pem = { 0 };
     struct buffer dst = alloc_buf_gc(TLS_CRYPT_V2_CLIENT_KEY_LEN
                                      + TLS_CRYPT_V2_MAX_WKC_LEN, &gc);
-    struct key2 client_key = { 2 };
+    struct key2 client_key = { .n = 2 };
 
     if (!rand_bytes((void *)client_key.keys, sizeof(client_key.keys)))
     {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/867?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iaaf80c688ddff79ac9472d7237003713637c140b
Gerrit-Change-Number: 867
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged